from framwork.common.tools  import open_browsers
from time import sleep
from selenium.webdriver.common.by import By

"""不选中短信模版 点击删除 ok"""
#数据
url=r"http://192.168.1.36/crm/index.php?m=user&a=login"
user_name="admin"
passwd="123456"
#定位器
username_locator=(By.NAME,"name")
password_locator=(By.NAME,"password")
login_btn_locator=(By.NAME,"submit")
gd_locator=(By.LINK_TEXT,"更多")
yx_locator=(By.LINK_TEXT,"营销")
setmodel_locator=(By.LINK_TEXT,"设置")
delmodel_locator=(By.ID,"btn_delete")
#操作
driver=open_browsers()
driver.get(url)
sleep(3)
driver.find_element(*username_locator).send_keys(user_name)
driver.find_element(*password_locator).send_keys(passwd)
driver.find_element(*login_btn_locator).click()
sleep(1)
driver.find_element(*gd_locator).click()
driver.find_element(*yx_locator).click()
driver.find_element(*setmodel_locator).click()
driver.find_element(*delmodel_locator).click()
sleep(1)
driver.switch_to.alert.dismiss()
#退出浏览器
sleep(3)
driver.close()